:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: var(--theme-text);
  background-color: var(--theme-bg);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* 主题 CSS 变量 */
  --theme-bg: #141414;
  --theme-text: #ffffff;
}

/* ===== 深色模式组件样式 ===== */
body.dark-mode {
  --antd-color-bg-base: #141414;
  --antd-color-text-base: #ffffff;
}

body.dark-mode .ant-modal,
body.dark-mode .ant-modal-confirm,
body.dark-mode .ant-popover,
body.dark-mode .ant-notification-notice,
body.dark-mode .ant-select-dropdown,
body.dark-mode .ant-picker-dropdown,
body.dark-mode .ant-tooltip,
body.dark-mode .ant-message-notice-wrapper,
body.dark-mode .ant-alert {
  --antd-color-bg-base: #141414;
  --antd-color-text-base: #ffffff;
}

body.dark-mode .ant-modal-content,
body.dark-mode .ant-modal-header,
body.dark-mode .ant-modal-body,
body.dark-mode .ant-modal-footer,
body.dark-mode .ant-modal-confirm-body-wrapper {
  background-color: #141414 !important;
  color: #ffffff !important;
  border-color: #434343 !important;
}

body.dark-mode .ant-modal-confirm-title,
body.dark-mode .ant-modal-confirm-content {
  color: #ffffff !important;
}

body.dark-mode .ant-modal-footer {
  background-color: #1f1f1f !important;
}

body.dark-mode .ant-modal-footer .ant-btn-default {
  background-color: #262626 !important;
  border-color: #434343 !important;
  color: #ffffff !important;
}

body.dark-mode .ant-modal-footer .ant-btn-default:hover {
  background-color: #1f4e79 !important;
  border-color: #1890ff !important;
  color: #ffffff !important;
}

body.dark-mode .ant-modal-footer .ant-btn-primary,
body.dark-mode .ant-modal-confirm .ant-btn-primary {
  background-color: #1890ff !important;
  border-color: #1890ff !important;
  color: #ffffff !important;
}

body.dark-mode .ant-modal-footer .ant-btn-primary:hover,
body.dark-mode .ant-modal-confirm .ant-btn-primary:hover {
  background-color: #40a9ff !important;
  border-color: #40a9ff !important;
  color: #ffffff !important;
}

body.dark-mode .ant-modal .ant-typography,
body.dark-mode .ant-modal .ant-typography-paragraph,
body.dark-mode .ant-modal .ant-typography-text {
  color: #ffffff !important;
}

body.dark-mode .ant-modal .ant-typography-secondary {
  color: #d9d9d9 !important;
}

body.dark-mode .ant-modal-close {
  color: #ffffff !important;
}

body.dark-mode .ant-modal-close:hover {
  background-color: #262626 !important;
}

body.dark-mode .ant-message-notice-content,
body.dark-mode .ant-notification-notice,
body.dark-mode .ant-popover-inner,
body.dark-mode .ant-select-dropdown,
body.dark-mode .ant-picker-dropdown,
body.dark-mode .ant-tooltip-inner,
body.dark-mode .ant-alert {
  background-color: #262626 !important;
  color: #ffffff !important;
  border: 1px solid #434343 !important;
}

body.dark-mode .ant-message-success .ant-message-notice-content,
body.dark-mode .ant-notification-notice-success,
body.dark-mode .ant-alert-success {
  background-color: rgba(82, 196, 26, 0.15) !important;
  border-color: #274240 !important;
  color: #b7eb8f !important;
}

body.dark-mode .ant-message-error .ant-message-notice-content,
body.dark-mode .ant-notification-notice-error,
body.dark-mode .ant-alert-error {
  background-color: rgba(255, 77, 79, 0.15) !important;
  border-color: #58181c !important;
  color: #ff7875 !important;
}

body.dark-mode .ant-message-warning .ant-message-notice-content,
body.dark-mode .ant-notification-notice-warning,
body.dark-mode .ant-alert-warning {
  background-color: rgba(255, 215, 5, 0.15) !important;
  border-color: #594214 !important;
  color: #ffc53d !important;
}

body.dark-mode .ant-message-info .ant-message-notice-content,
body.dark-mode .ant-message-loading .ant-message-notice-content,
body.dark-mode .ant-notification-notice-info,
body.dark-mode .ant-alert-info {
  background-color: rgba(24, 144, 255, 0.15) !important;
  border-color: #112a45 !important;
  color: #69b1ff !important;
}

body.dark-mode .ant-message-success .anticon {
  color: #52c41a !important;
}

body.dark-mode .ant-message-error .anticon {
  color: #ff4d4f !important;
}

body.dark-mode .ant-message-warning .anticon {
  color: #faad14 !important;
}

body.dark-mode .ant-message-info .anticon,
body.dark-mode .ant-message-loading .anticon {
  color: #1890ff !important;
}

body.dark-mode .ant-select-item,
body.dark-mode .ant-picker-cell {
  color: #ffffff !important;
}

body.dark-mode .ant-select-item:hover,
body.dark-mode .ant-picker-cell:hover {
  background-color: #1f4e79 !important;
}

body.dark-mode .ant-select-item-option-selected,
body.dark-mode .ant-picker-cell-selected {
  background-color: #1890ff !important;
  color: #ffffff !important;
}

body.dark-mode .ant-popover-title {
  color: #ffffff !important;
  border-bottom: 1px solid #434343 !important;
}

body.dark-mode .ant-notification-notice-close,
body.dark-mode .ant-tooltip-arrow::before {
  color: #ffffff !important;
}

/* ===== 搜索关键字高亮样式 ===== */
em {
  font-style: normal; /* 取消默认斜体 */
  font-weight: 600; /* 加粗 */
  color: #ff4d4f; /* 红色高亮 */
}

/* 深色模式下的高亮样式 */
body.dark-mode em {
  color: #ffa940; /* 橙色高亮 */
}
